#pragma once
#include "frame.h"
#include "qtmetamacros.h"

class FrameControl : public Frame
{
    Q_OBJECT
  public:
    enum class WheelLegSelection
    {
        left_front = 0b00,
        right_front = 0b01,
        left_rear = 0b10,
        right_rear = 0b11
    };
    enum class TopRocker
    {
        close = 0,
        open = 1
    };
    enum class BottomRocker
    {
        close = 0,
        open = 1
    };
    enum class LeftRocker
    {
        close = 0,
        open = 1
    };
    enum class RightRocker
    {
        close = 0,
        open = 1
    };
    enum class Rise
    {
        close = 0,
        open = 1
    };
    enum class Decline
    {
        close = 0,
        open = 1
    };
    enum class LeftRise
    {
        close = 0,
        open = 1
    };
    enum class LeftDecline
    {
        close = 0,
        open = 1
    };
    enum class RightRise
    {
        close = 0,
        open = 1
    };
    enum class RightDecline
    {
        close = 0,
        open = 1
    };
    enum class FrontAxleRise
    {
        close = 0,
        open = 1
    };
    enum class FrontAxleDecline
    {
        close = 0,
        open = 1
    };
    enum class RearAxleRise
    {
        close = 0,
        open = 1
    };
    enum class RearAxleDecline
    {
        close = 0,
        open = 1
    };
    enum class Reset
    {
        close = 0,
        open = 1
    };
    enum class AutonomousObstacleCrossing
    {
        close = 0,
        open = 1
    };
    enum class AutonomousTrenches
    {
        close = 0,
        open = 1
    };
    enum class PrepareCrossing
    {
        close = 0,
        open = 1
    };
    enum class RapidDecline
    {
        close = 0,
        open = 1
    };
    enum class AutoLeveling
    {
        close = 0,
        open = 1
    };

  public:
    WheelLegSelection wheel_leg_selection;
    TopRocker top_rocker;
    BottomRocker bottom_rocker;
    LeftRocker left_rocker;
    RightRocker right_rocker;
    Rise rise;
    Decline decline;
    LeftRise left_rise;
    LeftDecline left_decline;
    RightRise right_rise;
    RightDecline right_decline;
    FrontAxleRise front_axle_rise;
    FrontAxleDecline front_axle_decline;
    RearAxleRise rear_axle_rise;
    RearAxleDecline rear_axle_decline;
    Reset reset;
    AutonomousObstacleCrossing autonomous_obstacle_crossing;
    AutonomousTrenches autonomous_trenches;
    PrepareCrossing prepare_crossing;
    RapidDecline rapid_decline;
    AutoLeveling auto_leveling;
    unsigned char heart_beat;

  public:
    explicit FrameControl(QObject *parent = nullptr);
    ~FrameControl() = default;
    QByteArray EncodeToBytes() const;
    void DecodeFromBytes(const QByteArray &data);
    QString GetFrameName() const;
};